package halo.actors

import akka.actor.{Actor, Props}
import akka.routing.RoundRobinPool
import halo.messages.StartTask

/**
  * Created by jedi on 17-6-8.
  * 一个Leader同一个时间负责一个任务
  */
class Leader extends Actor{
  var workerNum = 10
  val workerGroup = context.actorOf(Props.create(classOf[Worker]).withRouter(new RoundRobinPool(workerNum)))
  val notifier = context.actorOf(Props.create(classOf[Notifier]))

  override def receive = {
    case StartTask(config) => {
      println(config)
    }
  }
}
